//
//  NSString+Extension.h
//  01-QQ聊天
//
//  Created by apple on 14-5-30.
//  Copyright (c) 2014年 heima. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSString (Extension)

/**
 *  计算文本占用的宽高
 *
 *  @param font    显示的字体
 *  @param maxSize 最大的显示范围
 *
 *  @return 占用的宽高
 */
- (CGSize)sizeWithFont:(UIFont *)font maxSize:(CGSize)maxSize;


///验证是否是正确的qq号
+ (Boolean)validateQQ:(NSString *)num;
+(Boolean)validateMobile:(NSString *)mobile;
///验证是否是正确的昵称
+ (Boolean)validateNicknName:(NSString *)name;

///删除首尾空格回车
+ (NSString*)deleteSpaceReturn:(NSString *)str;

///根据阿拉伯数字返回罗马数字目前支持1~5
-(NSString *)returnRomeWords;

//判断中英混合的的字符串长度
+ (int)convertToInt:(NSString*)strtemp;

// md5
+ (NSString *)md5:(NSString *)string;

//url 转译
+ (NSString *)stringByAddingURLEncoding:(NSString *)url;

//转数组
+ (NSArray *)arrayWithJsonString:(NSString *)jsonString;

//转字典
+ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString;

//获取富文本
+ (NSMutableAttributedString *)attributedAllString:(NSString *)allStr chengeString:(NSString *)str font:(UIFont *)font textColor:(UIColor *)textColor;

+ (NSMutableAttributedString *)attributedAllString:(NSString *)allStr chengeStrings:(NSArray *)strArray font:(UIFont *)font textColor:(UIColor *)textColor;

//过滤昵称表情
+(BOOL)stringContainsEmoji:(NSString *)string;

//url 转译
- (NSString *)stringByAddingPercentEscapesUsingEncoding;


@end
